package homework.exp05;

import java.io.File;
import java.io.FileInputStream;
import java.util.Arrays;
import java.util.Scanner;

public class D {
    static Scanner cin = null;

    static {
        try {
            cin = new Scanner(new FileInputStream(new File("D.in")));
        } catch (Exception e) {
            cin = new Scanner(System.in);
        }
    }

    public static void main(String[] args) {

        while (cin.hasNext()) {
            int n = cin.nextInt();
            int m = cin.nextInt();
            String[] a = new String[n];
            String[] b = new String[m];
            for (int i = 0; i < a.length; i++)
                a[i] = cin.next();
            for (int i = 0; i < b.length; i++)
                b[i] = cin.next();
            int u = f(a), v = f(b);
            System.out.println(u + " vs " + v + (v > u ? " GUEST WIN" : " HOST WIN"));
        }
        cin.close();
    }

    private static int f(String[] a) {
        Arrays.sort(a);
        char[] b = new char[a.length];
        for (int i = 0; i < a.length; i++)
            b[i] = a[i].charAt(0);
        int sum = 0, A = 0;
        for (int i = 0; i < a.length; i++) {
            if (b[i] < 'A' && b[i] > '1') sum += (int) b[i] - '0';
            if (b[i] == 'A') A++;
            if (b[i] > 'A' || b[i] == '1') sum += 10;
        }
        sum += A;
        if (sum > 21) {
            sum = 0;
        } else for (int i = 0; i < A; i++) {
            if (sum < 12) {
                sum += 10;
            }
        }
        return sum;
    }
}
